import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'

interface DataType {
    key: string;
    brand?: string;
    partition?: string;
    shop?: string;
    platform?: string;
    name: string;
    type: string;
    price: number;
    nums: number;
    sum: number;
    date: string;
    children?: DataType[];
}
@Schema()
export class Revenue {
   @Prop({type:String})
   key:string
   @Prop({type:String})
   brand?:string
   @Prop({type:String})
   platform?:string
   @Prop({type:String})
   partition?:string
   @Prop({type:String})
   shop?:string
   @Prop({type:String})
   name:string
   @Prop({type:String})
   type:string
   @Prop({type:Number})
   price:number
   @Prop({type:Number})
   nums:number
   @Prop({type:Number})
   sum:number
   @Prop({type:Array<DataType>})
   children?:DataType[]
   @Prop({type:String})
   date:string
}
export const RevenueSchema = SchemaFactory.createForClass(Revenue)